<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- <script src="js.js"></script> -->
</head>
<body>
    <script>
        // 变量 & 类型
        // let aa = 10;
        // console.log(typeof aa);
        // aa = "aaa";
        // console.log(typeof aa);
        // aa = true;
        // console.log(typeof aa);

        // let bb;
        // console.log(typeof bb);
        //运算符

        // let aa = 10;
        // let bb = "10";
        // console.log("aa==bb : "+ (aa==bb));
        // console.log("aa===bb : "+ (aa===bb));
        
        //数组定义
        // let array = [];
        // let array2= [10, "a", true];
        // //取值
        // console.log(array2[0]);
        // console.log(array2[1]);
        // //添加
        // array2[3] = "b";
        // console.log(array2);

        // array2[100] = "b";
        // console.log(array2.length);
        // //修改
        // array2[0] = 20;
        // console.log(array2);
        // //删除
        // array2.splice(1, 1);  // 第一个参数为删除的下标, 第二个参数为删除的个数
        // console.log(array2);

        // array2["中文"] = "dddd";
        // console.log(array2);

        //函数定义
        // sum(10,20,30);
        // function sum(x, y){
        //     console.log(x + y);
        // }

        
        // let sum = function(x,y){
        //     console.log(x + y);
        // }
        
        // sum(10,20);

        //对象定义
        let student = {};
        let student2 = {
            "name": "zhangsan",
            "age": 15
        };

        //读
        console.log(student2.name);
        console.log(student2["name"]);
        //修改
        student2.name = "lisi";
        console.log(student2.name);
        console.log(student2);
        //添加
        student.name = "空对象赋值";
        console.log(student);

        
        




    </script>
</body>
</html>